
	function atmos.LoadHooks()
		
		if( atmos.HooksLoaded ) then atmos.RemoveHooks() end
		
		hook.Add( "RenderScreenspaceEffects", "AtmosRSE", atmos.RenderSkyScreenspaceEffects )
		hook.Add( "PreDrawSkyBox", "AtmosPDSB", atmos.PreDrawSkyBox )

		local function RenderScene( origin, angles )

			-- save render information
			atmos.LastSceneOrigin = origin;
			atmos.LastSceneAngles = angles;

			-- base class
			return GAMEMODE.BaseClass.RenderScene( self, origin, angles );
			
		end
		hook.Add( "RenderScene", "AtmosRS", RenderScene )
		
		atmos.HooksLoaded = true;
		
	end
	
	function atmos.RemoveHooks()
	
		hook.Remove( "RenderScene", "AtmosRS" );
		hook.Remove( "PreDrawSkyBox", "AtmosPDSB" );
		hook.Remove( "RenderScreenspaceEffects", "AtmosRSE" );
		
		atmos.HooksLoaded = false;
		
	end
	
	function atmosRecvData( len )
		
		local tbl = net.ReadTable()
		
		atmos.AllowedMaps = tbl[1];
		atmos.StormData = tbl[2];
		
		print( "\n[atmos] Received map data from server." );
		
	end
	net.Receive( "atmosRecvData", atmosRecvData );
	
	function atmosStart( len )
		
		atmos.LoadHooks();
		print( "\n[atmos] Starting atmos." );
	
	end
	net.Receive( "atmosStart", atmosStart );
	
	if( atmos.ClientMode ) then atmos.LoadHooks() end
	
	-- debug/helpful commands
	concommand.Add( "cl_atmos_start", function( pl, cmd, args ) atmos.LoadHooks() end );
	concommand.Add( "cl_atmos_stop", function( pl, cmd, args ) atmos.RemoveHooks() end );
	concommand.Add( "cl_atmos_storm", function( pl, cmd, args ) if( atmos.Storming ) then atmos.StopStorm() else atmos.BeginStorm() end end );
	